package com.chapter3.search;

import java.util.Map;
import java.util.TreeMap;

import org.junit.Test;

/** 
 * @ClassName: TestCase 
 * @Description: TODO(这里用一句话描述这个类的作用) 
 * @author minjun minjun@bw30.com
 * @date 2015-2-18 上午2:57:45 
 *  
 */
public class TestCase {
	
	@Test
	public void testST(){
		RedBlackBST<String, String> s=
//				new SequentialSearchST<String, String>();
//				new BinarySearchST<String, String>();
				new RedBlackBST<String, String>();
		s.put("s", "sss");
		s.put("e", "eee");
		s.put("a", "aaa");
		s.put("r", "rr");
		s.put("c", "ccc");
//		s.delete("f");
//		System.out.println(s.contains("a"));
//		System.out.println(s.get("c")+","+s.size()
				//+",rank:"+s.rank("a")
//				);
//		s.print();
		System.out.println("---------------");
//		for(String k:s.keys()){
//			System.out.println(k+","+s.get(k));
//		}
	}

	@Test
	public void test(){
		Map<String,Object> map=
				new TreeMap<String, Object>();
//				new HashMap<String, Object>();
		map.put("jack", "kkkkkkkkkkk");
		map.put("tom", "mmmm");
		map.put("andy", "aa");
		map.put("jack", "dfd");
		map.put("bob", "dfdsdsf");
		
		System.out.println(map.get("aaa"));
//		for(Entry<String, Object> s:map.entrySet()){
//			System.out.println(s.getKey()+","+s.getValue());
//		}
	}
}
